namespace PraceDyplomowe2.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class DodajStudentaDoTematow : DbMigration
    {
        public override void Up()
        {
            AlterColumn("dbo.Temats", "StudentId", c => c.Int());
			Sql("UPDATE dbo.Temats SET StudentId = NULL;");
            AddForeignKey("dbo.Temats", "StudentId", "dbo.UserProfiles", "UserId");
            CreateIndex("dbo.Temats", "StudentId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.Temats", new[] { "StudentId" });
            DropForeignKey("dbo.Temats", "StudentId", "dbo.UserProfiles");
            AlterColumn("dbo.Temats", "StudentId", c => c.Int(nullable: false));
        }
    }
}
